#pragma once
#include "FLL_NXT_Navigation_Robot.h"

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


extern FLL_NXT_Navigation_Robot robot1;
namespace test_thingey {

	/// <summary>
	/// Summary for form2
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class form2 : public System::Windows::Forms::Form
	{
	public:
		form2(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
			textBox1->Text = robot1.WheelBase.ToString("0.0000");
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~form2()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::Button^  button_OK;
	private: System::Windows::Forms::Button^  button_cancel;
	private: System::Windows::Forms::Label^  Wheelbase;
	private: System::Windows::Forms::TextBox^  textBox1;

	protected: 

	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>
		System::ComponentModel::Container ^components;

#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->button_OK = (gcnew System::Windows::Forms::Button());
			this->button_cancel = (gcnew System::Windows::Forms::Button());
			this->Wheelbase = (gcnew System::Windows::Forms::Label());
			this->textBox1 = (gcnew System::Windows::Forms::TextBox());
			this->SuspendLayout();
			// 
			// button_OK
			// 
			this->button_OK->DialogResult = System::Windows::Forms::DialogResult::OK;
			this->button_OK->Location = System::Drawing::Point(55, 219);
			this->button_OK->Name = L"button_OK";
			this->button_OK->Size = System::Drawing::Size(73, 34);
			this->button_OK->TabIndex = 0;
			this->button_OK->Text = L"OK";
			this->button_OK->UseVisualStyleBackColor = true;
			this->button_OK->Click += gcnew System::EventHandler(this, &form2::button_OK_Click);
			// 
			// button_cancel
			// 
			this->button_cancel->DialogResult = System::Windows::Forms::DialogResult::Cancel;
			this->button_cancel->Location = System::Drawing::Point(144, 219);
			this->button_cancel->Name = L"button_cancel";
			this->button_cancel->Size = System::Drawing::Size(68, 33);
			this->button_cancel->TabIndex = 1;
			this->button_cancel->Text = L"Cancel";
			this->button_cancel->UseVisualStyleBackColor = true;
			// 
			// Wheelbase
			// 
			this->Wheelbase->AutoSize = true;
			this->Wheelbase->Location = System::Drawing::Point(52, 26);
			this->Wheelbase->Name = L"Wheelbase";
			this->Wheelbase->Size = System::Drawing::Size(61, 13);
			this->Wheelbase->TabIndex = 2;
			this->Wheelbase->Text = L"Wheelbase";
			this->Wheelbase->Click += gcnew System::EventHandler(this, &form2::label1_Click);
			// 
			// textBox1
			// 
			this->textBox1->Location = System::Drawing::Point(134, 24);
			this->textBox1->Name = L"textBox1";
			this->textBox1->Size = System::Drawing::Size(107, 20);
			this->textBox1->TabIndex = 3;
			this->textBox1->TextChanged += gcnew System::EventHandler(this, &form2::textBox1_TextChanged);
			// 
			// form2
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(284, 264);
			this->Controls->Add(this->textBox1);
			this->Controls->Add(this->Wheelbase);
			this->Controls->Add(this->button_cancel);
			this->Controls->Add(this->button_OK);
			this->Name = L"form2";
			this->Text = L"form2";
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void label1_Click(System::Object^  sender, System::EventArgs^  e) {
			 }
	private: System::Void textBox1_TextChanged(System::Object^  sender, System::EventArgs^  e) {
			 }
private: System::Void button_OK_Click(System::Object^  sender, System::EventArgs^  e) {
			 robot1.WheelBase = System::Convert::ToDouble(textBox1->Text);
			 robot1.WriteAppSettings(); //Updates variables
		 }
};
}
